﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
</head>
<body>
    <div id="d1" style="width:100%;height:3000px;position:relative;background-color:aliceblue;border:1px solid red;">
        <div id="d2" style="width:500px;height:200px;position:absolute;background-color:AppWorkspace;top:10px;left:50px;"></div>
    </div>
</body>
</html>
<script type="text/javascript">
    window.setInterval(function () {
       var st = document.documentElement.scrollTop ?document.documentElement.scrollTop:document.body.scrollTop;
        $("#d2").css("top", st + 5);
    }, 1);
</script>